package com.weme.common.base

import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.view.Gravity
import android.view.ViewGroup
import androidx.fragment.app.DialogFragment
import com.gyf.immersionbar.BarHide
import com.gyf.immersionbar.ImmersionBar
import com.weme.common.R

open class BaseDialog :DialogFragment() {

    override fun onStart() {
        super.onStart()
        dialog?.window?.apply {
            attributes.windowAnimations = R.style.DialogAnimation
            this.setWindowAnimations(R.style.SlideUpAnimation)
            setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
            setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
        }
        ImmersionBar.with(this).hideBar(BarHide.FLAG_HIDE_NAVIGATION_BAR).init()
    }

}